package com.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.until.DateFormatSerializer;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Emp implements Serializable {
    private Integer empId;
    private String empName;
    private String sex;
    private Integer age;
    private String idcard;
    private String address;
    private String phone;
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date hireDate;
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date leaveDate;
    private Integer status;
    private String username;
    private String password;
    private String salt;
    private Integer roleId;
    private Integer deptId;
    private Integer storesId;
    private Dept dept;
    private Role role;
    private Stores stores;
    private String deptName;
    private String roleName;
    private String storesName;
    private String empImg;
    @JsonSerialize(using = DateFormatSerializer.class)
    public Date getHireDate() {
        return hireDate;
    }
    @JsonSerialize(using = DateFormatSerializer.class)
    public Date getLeaveDate() {
        return leaveDate;
    }
}

